#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4583c002 |
|
23-Feb-2023 |
Simon Glass <sjg@chromium.org> |
patman: Move library functions into a library directory The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c18e5fb0 |
|
14-Jun-2022 |
Tom Rini <trini@konsulko.com> |
dtoc: Update test_src_scan.py for new tegra compatibles This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c1aa66e7 |
|
29-Jan-2022 |
Simon Glass <sjg@chromium.org> |
patman: Convert camel case in tools.py Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
43ba4926 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect drivers which do not parse correctly At present if a driver is missing a uclass or compatible stirng, this is silently ignored. This makes sense in most cases, particularly for the compatible string, since it is not required except when the driver is used with of-platdata. But it is also not very helpful. When there is some sort of problem with a driver, the missing compatible string (for example) may be the cause. Add a warning in this case, showing it only for drivers which are used by the build. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
|
#
86ff01e8 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Detect unexpected suffix on .of_match Some rockchip drivers use a suffix on the of_match line which is not strictly valid. At present this causes the parsing to fail. Fix this and offer a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
4f1727a7 |
|
04-Jul-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a stdout check in test_normalized_name() This test captures output but does not always check it. Add the missing code and drop the old comment. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
0c59acef |
|
25-Mar-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Show driver warnings once at the end At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
50aae3e6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support processing the root node The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
337d6972 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Set up the uclasses that are used We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests, now that we have uclasses we must create an explicit test for the case where a node does not have one. This should only happen if the source code does not build, or the source-code scanning fails to find it. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1d972697 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Warn of duplicate drivers If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
735ddfc6 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support headers needed for drivers Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b00f0066 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support tracking the phase of U-Boot U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
b9319c4f |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Track nodes which are actually used Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
dff51a52 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Move test files into a test/ directory It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
acf5cb88 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of structs in header files Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
1a8b4b9d |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Support scanning of uclasses Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c8b19b06 |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Collect priv/plat struct info from drivers In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
36b2220c |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Ignore unwanted files when scanning for drivers We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
c58662fc |
|
03-Feb-2021 |
Simon Glass <sjg@chromium.org> |
dtoc: Scan drivers for available information At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
970349a9 |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Tidy up src_scan tests Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
10ea9c0b |
|
28-Dec-2020 |
Simon Glass <sjg@chromium.org> |
dtoc: Move src_scan tests to a separate file Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
|